; void x_clip_pbm (int X, int Y, int ScreenOffs, char far * Bitmap);
;
; Bitmap is a planar bitmap, in the regular Xlib format.
;
; ax, bx, cx, and dx go south.
.code
public _x_clip_pbm
align 2
_x_clip_pbm proc
ARG X:word, Y:word, ScreenOffs:word, Bitmap:dword
LOCAL left_counter, right_counter,column,clipped_height,clipped_width,screen_pos,bitmap_pos,bitmap_size,VGA_mask,width_copy,height_temp,screen_width:word=LocalStk
; void x_clip_masked_pbm (int X, int Y, int ScreenOffs, char far * Bitmap);
;
; Bitmap is a planar bitmap, in the regular Xlib format.
; The width of the bitmap cannot be greater than 90 bytes, however.
; Ain't that just criminal?
;
; ax, bx, cx, and dx go south.
; one branch per pixel is more than enough -- we'll unroll the line-writing
; loop all the way to try to get a little speed (at the expense, as usual,
; of a chunk of memory)
MaskedPoint macro offset
mov al, [si + offset]
or al, al
jz $+6
mov es:[di + offset], al
endm
MaskedPointSize equ 11
public _x_clip_masked_pbm
align 2
_x_clip_masked_pbm proc
ARG X:word, Y:word, ScreenOffs:word, Bitmap:dword
; Tasm 1.0 does not allow the \ line continuation
LOCAL left_counter,right_counter,column:word,clipped_height,screen_pos,bitmap_pos,bitmap_size,VGA_mask,width_copy,height_temp,screen_width:word=LocalStk